<?php

declare(strict_types=1);
namespace app\common\business;

use app\common\lib\sms\TencentSms;
use app\common\lib\Number;
class Sms
{
    public static function sendCode(string $phone,int $lent):bool
    {
        $TemplateParamSet = Number::getCode($lent);
        $sms = TencentSms::sendmsg(config("redis.code_pre").$phone,$TemplateParamSet);
        if($sms){
            cache(config("redis.code_pre").$phone,$TemplateParamSet,config("redis.code_expire"));
        }
        return true;
    }

}